<?$this->headScript()->offsetSetFile(52,$this->baseUrl('js/jquery.ibutton.js'),'text/javascript');?>
<?$this->headLink()->appendStylesheet($this->baseUrl('css/jquery.ibutton.min.css'));?>



<?php $this->placeholder('onReady')->captureStart() ?>
	$("#<?php echo $this->id_tablesorter?>").tablesorter(); 

      $("input.iButton").iButton( {
            labelOn: "Si", 
            labelOff: "No",
            widthHandle:5,
            widthOn:15,
            widthOff:20,
      });

     $(document).on("change",'input.iButton', function(e){
        var aux = $(this).closest('tr').attr('id');
        var id= aux.replace('tr_','');
        name=$(this).attr('name');
        
        if(name=='validado_delineante') action='checkdelineante';
        else if(name=='validado_facility') action='checkfacility';
        else if(name=='validado_director') action='checkdirector';
        
        bFlag = $(this).is(':checked');
       	
        $.post('/cuadros/'+action,{id: id,idZona: <?=$this->idZona?>,checked:bFlag,name:name},function(data){
       	    if(data.status!=1){
       	        alert(data)
            }
        });
     })


    <?=$this->partial("snnipet/qtip.phtml");?>


<?php $this->placeholder('onReady')->captureEnd() ?>


<div class="contenedor_tablesorter">




<?if($this->msgPost) echo $this->partial('snnipet/atencion.phtml',array('msg'=>$this->msgPost));?>


<?php echo $this->insertarFila($this->controllerName,$this->idZona,null,'Nuevo Cuadro');?>




<?if($this->rows):?>
<table id="<?= $this->id_tablesorter?>" width="100%" class=""> 
    <?echo $this->partial('snnipet/caption.phtml',array('c'=>count($this->rows)));?>
    <thead>
    <tr>
        <th><?php echo $this->translate('Cuadro');?></th>
        <th><?php echo $this->translate('Espejo');?></th>
        <th><?php echo $this->translate('Sala');?></th>
        <th><?php echo $this->translate('Servicio');?></th>
        <th><?php echo $this->translate('Origen');?></th>
        <th><?php echo $this->translate('Calibre');?></th>
        <th><?php echo $this->translate('Remota');?></th>
        <th><?php echo $this->translate('Contador');?></th>
        <th><?php echo $this->translate('Proyectos');?></th>
        <th class="filter-false"><?php echo $this->translate('Informe');?></th>
        <th class="filter-false"><?php echo $this->translate('Unifilar');?></th>
        <th><?php echo $this->translate('Fecha Cambio CIR');?></th>
        <th class="filter-false"><?php echo $this->translate('Validado Delineante');?></th>
        <th class="filter-false"><?php echo $this->translate('Validado Facility');?></th>
        <th class="filter-false"><?php echo $this->translate('Validado Director');?></th>
        <th><?php echo $this->translate('Notas');?></th>
        <th class="filter-false"></th>
    </tr>
    </thead>
    <tbody>
        <?php echo $this->partialLoop($this->controllerName.'/fila.phtml', (array)$this->rows); ?>	
    </tbody>
</table>
<?endif?>
</div>

